<?php
$this->breadcrumbs = array(
    'Admin - Manager'
);
?>
<div class="box">
    <header>
        <div class="icons"><i class="icon-user"></i></div>
        <h5>Admin manager</h5>
    </header>
    <div class="body">
        <?php
        $this->widget('bootstrap.widgets.TbGridView', array(
            'dataProvider' => $model->search(),
            'filter' => $model,
            'type'=>'bordered condensed striped',
            'columns' => array(
                array(
                    'name' => 'admin_id',
                    'htmlOptions' => array('width' => '50'),
                    'header' => 'ID'
                ),
                'admin_login',
                'admin_nicename',
                'admin_email',
                array(
                    'name' => 'admin_role',
                    'value'=> '$data->getRolesText()',
                    'filter' => Admin::getRoles()
                ),
                array(
                    'name' => 'admin_status',
                    'value'=> '$data->getStatusText()',
                    'filter' => Admin::getStatus()
                ),
                array(
                    'header'=>'Joined',
                    'name' => 'timeFilter',
                    'type' => 'date',
                    'value'=>'$data->admin_registered'
                ),
                array(
                    //Button Group
                    'header' => 'Action',
                    'value' => function($data) {
                        app()->getController()->widget('bootstrap.widgets.TbButtonGroup', array(
                            'size' => 'mini',
                            'type' => 'inverse', // '', 'primary', 'info', 'success', 'warning', 'danger' or 'inverse'
                            'buttons' => array(
                                array(
                                    'icon' => 'align-right',
                                    'type' => '',
                                    'items' => array(
                                        array(
                                            'label' => 'View',
                                            'url' => url('admin/view', array('id' => $data->admin_id))
                                        ),
                                        array(
                                            'label' => 'Update',
                                            'url' => url('admin/update', array('id' => $data->admin_id)),
                                        ),
                                        array(
                                            'label' => 'Delete',
                                            'url' => url('admin/delete', array('id' => $data->admin_id)),
                                        ),
                                    ),
                                ),
                            ),
                        ));
                    }
                //TbButton Column
//                    'class' => 'bootstrap.widgets.TbButtonColumn',
//                    'template' => '{view} {update} {delete}',
//                    'header' => 'Action',
                )
            )
        ));
        ?>
    </div>
</div>